package com.nrgedge.magnolia.setup;

import info.magnolia.module.DefaultModuleVersionHandler;
import info.magnolia.module.InstallContext;
import info.magnolia.module.delta.IsInstallSamplesTask;
import info.magnolia.module.delta.Task;
import info.magnolia.module.inplacetemplating.setup.TemplatesInstallTask;

import java.util.List;

public class JsTemplateSupportVersionHandler extends DefaultModuleVersionHandler {

	@Override
	protected List<Task> getBasicInstallTasks(final InstallContext installContext) {
		final List<Task> tasks = super.getBasicInstallTasks(installContext);
		
		tasks.add(new IsInstallSamplesTask("Add sample JS Template FTLs", "", new TemplatesInstallTask("/js-template-support/.*\\.ftl", true)));
		
		//tasks.add(new IsAuthorInstanceDelegateTask("Remove Rendering Filter Task", "", (Task) new RemoveNodeTask("Remove Rendering Filter Task", "", RepositoryConstants.CONFIG, "/server/filters/cms/rendering")));
		//tasks.add(new IsAuthorInstanceDelegateTask("Add Mustache Filter Task", "", (Task) new BootstrapSingleResource("Add Mustache Filter Task", "", "/mgnl-author-bootstrap/config.server.filters.cms.mustache.xml")));
		//tasks.add(new IsAuthorInstanceDelegateTask("Add Rendering Filter Task", "", (Task) new BootstrapSingleResource("Add Rendering Filter Task", "", "/mgnl-author-bootstrap/config.server.filters.cms.rendering.xml")));
		return tasks;

	}
}
